<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="/templates/ui.xhtml">

<ui:define name="head">
    <script type="text/javascript">
        function doPopupRefundWindow(obj) {
            var pkid = obj.parentNode.parentNode.childNodes[0].innerHTML;
            popupwindow = window.open("refundDetlForm.xhtml?action=query&amp;pkid=" + pkid, "popupwindow", "height=600,width=800,left=200,top=100,toolbar=no,menubar=no,scrollbars=yes,location=no");
            popupwindow.focus;
        }
    </script>
    <style type="text/css">
        .input-col-m {
            width: 60px;
        }

        .input-col-l {
            width: 80px;
        }

        .input-col-xxl {
            width: 1%;
            text-align: right;
        }

        .col-80 {
        }

        .col-20 {
            width: 5%;
        }
    </style>

</ui:define>

<ui:define name="content">
<div style="margin:5px;">
<p:tabView style="font-weight:normal;font-style:normal" dynamic="true" cache="false">
<p:tab title="待入账记录清单">
    <p:growl id="msgs2" showDetail="false"/>
    <h:form id="form2">
        <p:menubar>
            <p:menuitem type="push" value="入账" icon="ui-icon ui-icon-document"
                        action="#{refundAction.onExecAccount}" update="msgs2, pdt2" ajax="true"/>

        </p:menubar>
        <p:ajaxStatus style="height:18px;text-align:center">
            <f:facet name="start">
                <h:graphicImage value="/images/ajaxloadingbar.gif"/>
            </f:facet>
            <f:facet name="complete">
                <h:outputText value=""/>
            </f:facet>
        </p:ajaxStatus>
        <p:dataTable id="pdt2" style="width:100%;"
                     dynamic="true" selection="#{refundAction.selectedRefundRecords}"
                     value="#{refundAction.pendActList}" var="record"
                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                     paginator="true" rows="15" paginatorPosition="bottom"
                     rowsPerPageTemplate="100,50,30,15,5"
                     emptyMessage="数据记录为空...">
            <p:column style="display:none;" headerText="pkid">
                <h:outputText value="#{record.pkId}"/>
            </p:column>
            <p:column selectionMode="multiple"/>
            <p:column headerText="凭证号" style="text-align:center" filterBy="#{record.docNo}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.docNo}"/>
            </p:column>
            <p:column headerText="付款开发商" style="text-align:center" filterBy="#{record.payCompanyName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.payCompanyName}"/>
            </p:column>
            <p:column headerText="收款方户名" style="text-align:center" filterBy="#{record.recCompanyName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.recCompanyName}"/>
            </p:column>
            <p:column headerText="收款方帐号" style="text-align:center" filterBy="#{record.recAccount}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.recAccount}"/>
            </p:column>

            <p:column headerText="退款金额">
                <h:outputText value="#{record.plAmount}" style="float: right">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:outputText>
            </p:column>
            <!--<p:column headerText="申请人" style="text-align:center" filterBy="#{record.applyUserName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.applyUserName}"/>
            </p:column>-->
            <p:column headerText="申请日期" style="text-align:center">
                <h:outputText value="#{record.applyDate}">
                </h:outputText>
            </p:column>
            <p:column headerText="交易状态" style="text-align:center" filterBy="#{record.statusFlag}"
                      filterOptions="#{refundAction.refundStatusOptions}"
                      filterMatchMode="exact">
                <h:outputText
                        value="#{refundAction.refundStatus.valueOfAlias(record.statusFlag).title}"/>
            </p:column>
            <p:column headerText="操作" style="width:50px;text-align:center">
                <p:commandLink style="color:blue;" value="详细" update="popupwindow"
                               onclick="doPopupRefundWindow(this);">
                </p:commandLink>
            </p:column>
        </p:dataTable>
    </h:form>
</p:tab>
<p:tab title="待发送记录清单">
    <p:growl id="msgs3" showDetail="false"/>
    <h:form id="form3">
        <p:menubar>
            <p:menuitem type="push" value="发送" icon="ui-icon ui-icon-document"
                        action="#{refundAction.onSend}" update="msgs3, pdt2,pdt3,pdt4" ajax="true"/>

        </p:menubar>
        <p:ajaxStatus style="height:18px;text-align:center">
            <f:facet name="start">
                <h:graphicImage value="/images/ajaxloadingbar.gif"/>
            </f:facet>
            <f:facet name="complete">
                <h:outputText value=""/>
            </f:facet>
        </p:ajaxStatus>
        <p:dataTable id="pdt3" style="width:100%;"
                     dynamic="true" selection="#{refundAction.selectedRefundRecords}"
                     value="#{refundAction.pendToSendList}" var="record"
                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                     paginator="true" rows="15" paginatorPosition="bottom"
                     rowsPerPageTemplate="100,50,30,15,5"
                     emptyMessage="数据记录为空...">
            <p:column style="display:none;" headerText="pkid">
                <h:outputText value="#{record.pkId}"/>
            </p:column>
            <p:column selectionMode="multiple"/>
            <p:column headerText="凭证号" style="text-align:center" filterBy="#{record.docNo}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.docNo}"/>
            </p:column>
            <p:column headerText="付款开发商" style="text-align:center" filterBy="#{record.payCompanyName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.payCompanyName}"/>
            </p:column>
            <p:column headerText="收款方户名" style="text-align:center" filterBy="#{record.recCompanyName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.recCompanyName}"/>
            </p:column>
            <p:column headerText="收款方帐号" style="text-align:center" filterBy="#{record.recAccount}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.recAccount}"/>
            </p:column>

            <p:column headerText="退款金额">
                <h:outputText value="#{record.plAmount}" style="float: right">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:outputText>
            </p:column>
            <!--<p:column headerText="申请人" style="text-align:center" filterBy="#{record.applyUserName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.applyUserName}"/>
            </p:column>-->
            <p:column headerText="申请日期" style="text-align:center">
                <h:outputText value="#{record.applyDate}">
                </h:outputText>
            </p:column>
            <p:column headerText="交易状态" style="text-align:center" filterBy="#{record.statusFlag}"
                      filterOptions="#{refundAction.refundStatusOptions}"
                      filterMatchMode="exact">
                <h:outputText
                        value="#{refundAction.refundStatus.valueOfAlias(record.statusFlag).title}"/>
            </p:column>
            <p:column headerText="操作" style="width:50px;text-align:center">
                <p:commandLink style="color:blue;" value="详细" update="popupwindow"
                               onclick="doPopupRefundWindow(this);">
                </p:commandLink>
            </p:column>
        </p:dataTable>
    </h:form>
</p:tab>
<p:tab title="已发送记录清单">
    <p:growl id="msgs4" showDetail="false"/>
    <h:form id="form4">

        <p:ajaxStatus style="height:18px;text-align:center">
            <f:facet name="start">
                <h:graphicImage value="/images/ajaxloadingbar.gif"/>
            </f:facet>
            <f:facet name="complete">
                <h:outputText value=""/>
            </f:facet>
        </p:ajaxStatus>
        <p:dataTable id="pdt4" style="width:100%;"
                     dynamic="true" selection="#{refundAction.selectedRefundRecords}"
                     value="#{refundAction.pendSentList}" var="record"
                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                     paginator="true" rows="15" paginatorPosition="bottom"
                     rowsPerPageTemplate="100,50,30,15,5"
                     emptyMessage="数据记录为空...">
            <p:column style="display:none;" headerText="pkid">
                <h:outputText value="#{record.pkId}"/>
            </p:column>

            <p:column headerText="凭证号" style="text-align:center" filterBy="#{record.docNo}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.docNo}"/>
            </p:column>
            <p:column headerText="付款开发商" style="text-align:center" filterBy="#{record.payCompanyName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.payCompanyName}"/>
            </p:column>
            <p:column headerText="收款方户名" style="text-align:center" filterBy="#{record.recCompanyName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.recCompanyName}"/>
            </p:column>
            <p:column headerText="收款方帐号" style="text-align:center" filterBy="#{record.recAccount}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.recAccount}"/>
            </p:column>

            <p:column headerText="退款金额">
                <h:outputText value="#{record.plAmount}" style="float: right">
                    <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
                </h:outputText>
            </p:column>
            <!--<p:column headerText="申请人" style="text-align:center" filterBy="#{record.applyUserName}"
                      filterMatchMode="contains">
                <h:outputText value="#{record.applyUserName}"/>
            </p:column>-->
            <p:column headerText="申请日期" style="text-align:center">
                <h:outputText value="#{record.applyDate}">
                </h:outputText>
            </p:column>
            <p:column headerText="交易状态" style="text-align:center" filterBy="#{record.statusFlag}"
                      filterOptions="#{refundAction.refundStatusOptions}"
                      filterMatchMode="exact">
                <h:outputText
                        value="#{refundAction.refundStatus.valueOfAlias(record.statusFlag).title}"/>
            </p:column>
            <p:column headerText="操作" style="width:50px;text-align:center">
                <p:commandLink style="color:blue;" value="详细" update="popupwindow"
                               onclick="doPopupRefundWindow(this);">
                </p:commandLink>
            </p:column>
        </p:dataTable>
    </h:form>
</p:tab>
</p:tabView>
</div>

</ui:define>

</ui:composition>